﻿using System;
using System.IO;

namespace Woolpert.Compression
{
    /// <summary>
    /// Zips files up
    /// </summary>
    public interface IFileZipUtility
    {
        /// <summary>
        /// Zips files from a directory and subdirectories
        /// </summary>
        /// <param name="zipFilePath">The name of the zipped file</param>
        /// <param name="directory">directory to zip files up in</param>
        void GenerateZipFile(string zipFilePath, string directory);

        /// <summary>
        /// Zips files from a directory and subdirectories if recursive is true
        /// </summary>
        /// <param name="zipFilePath">The name of the zipped file</param>
        /// <param name="directory">directory to zip files up in</param>
        /// <param name="recursive">Would you like to zip up subdirectories as well?</param>
        void GenerateZipFile(string zipFilePath, string directory, bool recursive);


        /// <summary>
        /// Zips a single file in to a compressed archive
        /// </summary>
        /// <param name="zipFilePath">The full name of the zip file that
        /// will be created, e.g., "C:\Temp\MyArchive.7z". Make 
        /// sure that the file extension is appropriate to the 
        /// archive format that you are creating, e.g., zip or 7z.
        /// 
        /// If the archive already exists then the file will be added
        /// to that archive. Delete any existing files first if you
        /// want a fresh archive.</param>
        /// <param name="file">The file that you want to compress</param>
        void GenerateZipFile(string zipFilePath, FileInfo file);

        /// <summary>
        /// Unzips all of the contents of a compressed archive
        /// to a single directory
        /// </summary>
        /// <param name="zipFilePath">The full name of the zip file
        /// that you want to uncompress, e.g., "C:\Temp\MyArchive.7z"</param>
        /// <param name="outputDirectory">An existing directory
        /// to which all the contents of the <paramref name="zipFilePath"/>
        /// will be extracted.</param>
        void Unzip(string zipFilePath, string outputDirectory);
    }
}